package com.wangshouyu.mp.pay.unified;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @description 统一下单返回结果
 * @date 2020/8/13 12:25
 */
public abstract class BaseUnifiedResponse implements Serializable {

    /**
     * 返回码
     */
    @XStreamAlias(value = "return_code")
    private String returnCode;

    /**
     * 返回消息
     */
    @XStreamAlias(value = "return_msg")
    private String returnMsg;

    public String getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    public String getReturnMsg() {
        return returnMsg;
    }

    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BaseUnifiedResponse that = (BaseUnifiedResponse) o;
        return Objects.equals(returnCode, that.returnCode) &&
                Objects.equals(returnMsg, that.returnMsg);
    }

    @Override
    public int hashCode() {
        return Objects.hash(returnCode, returnMsg);
    }

    @Override
    public String toString() {
        return "BaseUnifiedResponse{" +
                "returnCode='" + returnCode + '\'' +
                ", returnMsg='" + returnMsg + '\'' +
                '}';
    }
}
